import {debounce} from './utils';
import BackTop from '../components/content/backTop/BackTop';

export const itemListenerMixin = {
  mounted() {
    let refresh = debounce(this.$refs.scroll.refresh, 500);
    this.itemImgListener = () => {
      refresh();
    };
    this.$bus.$on('itemImgLoad', this.itemImgListener);
  }
};

export const backTopMixin = {
  components: {
    BackTop
  },

  data() {
    return {
      isShow: false,
    }
  },
  methods: {
    backClick() {
      this.$refs.scroll.scrollTo(0, 0);
    }
  }
};
